﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

namespace LMIS_Application
{
    public partial class AddBookInstance : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnAddBook_Click(object sender, EventArgs e)
        {
            int bookId;
            try
            {
                bookId = Convert.ToInt32(tbBookID.Text);
            }
            catch (Exception x)
            {
                info.Text = "Adding book copy was unsucessful";
                return;
            }

            Inv i = new Inv();
            int outcome = i.addBookCopy(bookId);

            if (outcome != -1)
            {
                info.Text = "Book copy added! Book Copy ID = " + outcome;
            }
            else
            {
                info.Text = "Adding book copy was unsucessful";
            }
        }
    }
}
